home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1998 Macromedia, Inc. All rights reserved.
-
- //*************** GLOBALS VARS *****************
-
- //******************* BEHAVIOR FUNCTION **********************
-
- //Restores a set of images to their previous source files.
- //Accepts a variable number of params, in pairs read from a global property:
- // objStr - Javascript object ref for an image (ex: document.myImage)
- // imgURL - original image filename, URL encoded. (ex: file.gif, http://www.x.com/y.gif)
- //
- //This is the companion Action to Swap Image. Swap Image gathers the original
- //image src filenames, and writes document.MM_swapImageData before changing the images.
- //This sets the images src properties back to their original filenames:
- // document.myImage.src = file.gif.
-
- function MM_swapImgRestore() { //v2.0
- if (document.MM_swapImgData != null)
- for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
- document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
- }
-
-
- //******************* API **********************
-
-
- //Checks for the existence of images.
- //If none exist, returns false so this Action is grayed out.
-
- function canAcceptBehavior(){
- var nameArray = getObjectRefs("NS 4.0","document","IMG"); //get array of image names
- return (nameArray.length > 0);
- }
-
-
-
- //Returns a Javascript function to be inserted in HTML head with script tags.
-
- function behaviorFunction(){
- return "MM_swapImgRestore";
- }
-
-
-
- //Returns simple fn call, no args
- function applyBehavior() {
- return "MM_swapImgRestore()";
- }
-
-
-
- //Passed the function call above, does nothing (no args to handle)
- function inspectBehavior(){
- }
-